package sb.de.advanceShopper.activities;

import sb.de.advanceShopper.R;
import sb.de.advanceShopper.model.Country;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;

public class AdvanceShopperActivity extends Activity {
	
	//TODO relocate this code
	public static final Country[] COUNTRIES = {new Country(0, "Deutschland")};
	
	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.main);
	}

	public void pressShopping(View v) {
		Intent intentShopping = new Intent(this, ShoppingActivity.class);
		startActivity(intentShopping);
	}

	public void pressShops(View v) {
		Intent intentShops = new Intent(this, ShopsActivity.class);
		startActivity(intentShops);
	}

	public void pressItems(View v) {
		Intent intentItems = new Intent(this, ItemsActivity.class);
		startActivity(intentItems);
	}

	public void pressReports(View v) {
		Intent intentReports = new Intent(this, ReportsActivity.class);
		startActivity(intentReports);
	}

	//TODO relocate this code
	public static Country getCountryByName(String countryName) {
		for (Country tmpCountry : COUNTRIES) {
			if (countryName.equals(tmpCountry.getName())) {
				return tmpCountry;
			}
		}
		throw new IllegalArgumentException("There is no " + countryName + " in records.");
	}

}